package com.zpp.wedding_admin.utils;

import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.fasterxml.jackson.databind.ObjectMapper;

public class GetObjectClass {

    public static<T> T convert(Object obj, Class<T> type) {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.registerModule(new JavaTimeModule());
        T t = objectMapper.convertValue(obj, type);
        return t;
    }
}
